package com.amit.hibernate;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.Transaction;

public class Lab3Client2 {

	public static void main(String[] args) {
		
		SessionFactory sessionfactory=CHibernateUtil.getfactory();
		Session session=sessionfactory.openSession();
		Transaction tx=session.beginTransaction();
		
		Student stu=(Student) session.load(Student.class, 1);
		System.out.println(stu.getSid()+" "+stu.getName()+" "+stu.getDob());
		System.out.println(".............");
		
		for(String cn:stu.getCourses())
		{
		System.out.println(cn);	
		}
		System.out.println("...");
		System.out.println(stu.getEmails());
		System.out.println("....");
		System.out.println(stu.getMarks());
		System.out.println("....");
		System.out.println(stu.getPhones());
		System.out.println("...");
		System.out.println(stu.getRefs());
		
		tx.commit();
		session.close();
		
		
		
		

	}

}
